package com.crm.business.crm.mapper;


import com.crm.common.crm.entity.BO.CrmRoiSearchBO;
import com.crm.common.crm.entity.PO.CrmHeadquartersBusinessBalance;
import com.crm.business.servlet.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface CrmHeadquartersBusinessBalanceMapper extends BaseMapper<CrmHeadquartersBusinessBalance> {
    List<CrmHeadquartersBusinessBalance> queryPageList(@Param("data") CrmRoiSearchBO search);

    /**
     * 根据组织Id查询充值信息
     * @param deptId
     * @return
     */
    CrmHeadquartersBusinessBalance queryDataBySource(String topUpSource, Integer deptId);

    CrmHeadquartersBusinessBalance queryDataByDeptId(@Param("deptId") Integer deptId, @Param("source") String source);

    BigDecimal queryBalanceByDeptIds(@Param("deptIds") List<Integer> deptIds);

    void updateBalanceByDeptId(@Param("deptId") Integer deptId, @Param("balance") BigDecimal balance, @Param("topUpSource") String topUpSource);

    Integer queryRow();
}
